//
//  RegisterEmailCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2017/12/28.
//  Copyright © 2017年 beisheng. All rights reserved.
//

#import "RegisterEmailCell.h"

@interface RegisterEmailCell ()
@property (weak, nonatomic) IBOutlet UITextField *rightTextField;
@property (weak, nonatomic) IBOutlet UILabel *topLabel;

@end

@implementation RegisterEmailCell

- (void)awakeFromNib {
    
    [super awakeFromNib];
    
    self.rightTextField.font = MYFONT(15);
    
    self.topLabel.font = MYFONT(15);
    
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(textChange) name:UITextFieldTextDidChangeNotification object:self.rightTextField];
    
    
}

- (void)setModel:(RegisterInfoModel *)model{
    
    _model = model;
    
    if (_model.email.length > 0) {
        
        self.rightTextField.text = _model.email;
    }
    
    
    if ([model.type isEqualToString:@"motify"]) {
        
        self.topLabel.text = @"手机号";
        
        self.rightTextField.userInteractionEnabled = NO;
        
    } else {
        
        self.topLabel.text = @"输入您的手机号";

        self.rightTextField.userInteractionEnabled = YES;
    }
    
}


- (void)textChange{
    
    self.model.email = self.rightTextField.text;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
